Repository navigation
Add ability to disable HTTPS Everywhere for specific domains without first visiting the site (#17434) - #17890
bershanskiy wants to merge 13 commits into
Conversation
|
@bershanskiy Use camelCase and |
|
It would make sense to allow left-side wildcards, such as |
|
@pipboy96 Thanks for the prompt reply.
Will do.
Currently it allows wildcards, as well as anything else you put in the box. In fact, there is no validation performed at all (which is definitely bad). Could you write-up exact criteria for input validation? I understand it as follows:
I did not make sure the background scripts support wildcards yet. But I'll definitely do that before merging. |
|
@bershanskiy I will write a JS function to validate domains. |
|
I think port numbers are not allowed. |
Great. Will you also implement the error message display for invalid entries or should I do that?
Could you double-check? The popup UI Is there anything I should do to advance this PR besides changing to camelCase and |
|
@bershanskiy Generally, HTTPS Everywhere doesn't seem to handle custom ports well, e.g. https://example.com and https://example.com:443 are treated like different origins. |
|
You would also need to |
|
Probably some kind of punycode encoder/decoder would also be needed. |
…17434) This allows user to add a domain name to the whitelist from within Options menu (without visiting the site). No domain validation is performed.
|
This is code to encode/decode punycode: https://gist.github.com/pipboy96/cd3b89bf9598e90c0c2dda4e9fe9c286 |
|
Regex: |
|
I recommend you to show IDNs in this way: "xn--80acde.xn--j1aef (абвг.ком)" but obviously store in encoded form. |
Will do. Also, could you go over the What is the proper order of The linter does not see the definition of Punycode functions: May be you have an idea where to add the proper includes/ exclusions? |
|
toLowerCase may do weird things for non-ASCII chars depending on OS locale. Do it after toASCII. |
That's what I was thinking too. |
|
I was going to lint anyway, but thanks! |
| <script src="../util.js" defer></script> | ||
| <script src="../punycode.js" defer></script> | ||
| <script src="ux.js" defer></script> | ||
| <script src="../translation.js" defer></script> |
There was a problem hiding this comment.
Also move to end of <body>.
There was a problem hiding this comment.
I did not use async because scripts have dependencies on each other. ux.js and translation.js can be made into async because they wait for "DOMContentLoaded" anyway, but they do need util.js and punycode.js to be loaded in advance. I think I can make translation.js into async, but not the others.
There was a problem hiding this comment.
I moved those to the end of <body> and made translation.js async, but ux.js still needs util.js and punycode.js to run before it so I mad them defer to preserve order.
|
Linter was also complaining about indentation, so I changed that. However, Travis still complains about "preload", which should not be impacted by this PR, since it does not change any rules... |
|
@bershanskiy hsts-prune needs |
|
@bershanskiy Can you fix merge conflicts? |
|
@pipboy96 I resolved conflicts on this one via the GitHub online interface as well, but I'll test it for real too. I'll comment when I'm done. |
|
@bershanskiy Do you have any plans to continue work on this? |
|
Closing out for now, can reopen at request of the author. |
WORK IN PROGRESS! DO NOT MERGE!
This allows user to add a domain name to the whitelist from within Options menu (without visiting the site). No domain validation is performed.
This is an incredibly simplistic implementation (e.g., no domain validation or Punycode encoding or any CSS work) so please tell me which things I should change.
Preview
I decided to put the form under the disabled list title on "General" page because it seemed more natural than putting it on "Advanced" page.
Domain names validation
What is the preferred validation method? Internally, HTTPS Everywhere seems to prefer IDN in Punycode and does not allow wild cards. Should I enforce this and display error messages? What
Preferred code style
leteven though they can be declared asconst. Is this intentional?CC @raman325 @pipboy96